<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>gears (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">gears</span>
</div>

<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_gears_BaseStore.html">
          goog.gears.BaseStore</a><br/>
        <div class="class-details">This class implements the common store functionality</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_Database.html">
          goog.gears.Database</a><br/>
        <div class="class-details">Class that for accessing a Gears database</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_LogStore.html">
          goog.gears.LogStore</a><br/>
        <div class="class-details">Implements a store for goog.debug.Logger data.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_LoggerClient.html">
          goog.gears.LoggerClient</a><br/>
        <div class="class-details">Singleton class that overrides the goog.debug.Logger to send log commands
to the main thread.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_LoggerServer.html">
          goog.gears.LoggerServer</a><br/>
        <div class="class-details">Creates an object that listens to incoming LOG commands and forwards them
to a goog.debug.Logger</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_ManagedResourceStore.html">
          goog.gears.ManagedResourceStore</a><br/>
        <div class="class-details">Creates a ManagedResourceStore with the specified name and update.  This
follows the Closure event model so the COMPLETE event will fire both for
SUCCESS and for ERROR.  You can use <code>isSuccess</code> in UPDATE to see if the
capture was successful or you can just listen to the different events.

This supports PROGRESS events, which are fired any time <code>filesComplete</code>
or <code>filesTotal</code> changes.  If the Gears version is 0.3.6 or newer this
will reflect the numbers returned by the underlying Gears MRS but for older
Gears versions this will just be <code>0</code> or <code>1</code>.

NOTE: This relies on at least the 0.2 version of gears (for timer).</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_ManagedResourceStoreEvent.html">
          goog.gears.ManagedResourceStoreEvent</a><br/>
        <div class="class-details">Event used when a ManagedResourceStore update is complete</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_MultipartFormData.html">
          goog.gears.MultipartFormData</a><br/>
        <div class="class-details">Creates a new multipart form data builder.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_UrlCapture.html">
          goog.gears.UrlCapture</a><br/>
        <div class="class-details">Class capture URLs to a ResourceStore on the LocalServer.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_Worker.html">
          goog.gears.Worker</a><br/>
        <div class="class-details">This is an absctraction of workers that can be used with Gears WorkerPool.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_WorkerChannel.html">
          goog.gears.WorkerChannel</a><br/>
        <div class="class-details">Creates a message channel for the given Gears worker.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_WorkerEvent.html">
          goog.gears.WorkerEvent</a><br/>
        <div class="class-details">Event used when the worker recieves a message</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_gears_WorkerPool.html">
          goog.gears.WorkerPool</a><br/>
        <div class="class-details">This class implements a wrapper around the Gears Worker Pool.</div>
 </div>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>



<h2>Enumerations</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.gears.StatusType"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">StatusType</span>
        : 
     </div>


     <div class="entryOverview">
       The possible status type's for Gears.
     </div>

     <div class="entryDetails">
       <div class="detailsSection">
          <b>Constants:</b>
          <table class="horiz-rule">
            <tbody>
              <tr><td>
                <span class="entryName">
                  NOT_INSTALLED
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  ONLINE
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  SYNCING
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  PAUSED
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  CAPTURING
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  OFFLINE
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  ERROR
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
              <tr><td>
                <span class="entryName">
                  INSTALLED
                </span>
                <div class="entryOverview">
                  <span class='nodesc'>No description.</span>
                </div>
             </td></tr>
           </tbody>
         </table>
       </div>
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_gears_statustype.js.source.html#line28">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.gears.getFactory"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">getFactory<span class="args">()</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Returns a new Gears factory object.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            the Gears factory object if available or null otherwise.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line33">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.gears.hasFactory"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">hasFactory<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Whether we can create a Gears factory object. This does not cache the
result.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            true if we can create a Gears factory object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line126">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.gears.makeSafeFileName"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">makeSafeFileName<span class="args">(<span class="arg">originalFileName</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Gears only allows file names up to 64 characters, so this function shortens
file names to fit in this limit. #goog.string.hashCode is used to compress
the name. This also removes invalid characters.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">originalFileName</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Original (potentially unsafe) file name.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Safe file name. If originalFileName null or empty, return originalFileName.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line203">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.gears.tryGearsObject_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">tryGearsObject_<span class="args">()</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
      </div>


     <div class="entryOverview">
       Attempt to create a factory by adding an object element to the DOM.
This covers the case for safari.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>&nbsp;
            The factory, or null.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line78">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.gears.MAX_FILE_NAME_LENGTH_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">MAX_FILE_NAME_LENGTH_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Maximum file name length.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line182">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.gears.MAX_FILE_NAME_PREFIX_LENGTH_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">MAX_FILE_NAME_PREFIX_LENGTH_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Allow 10 characters for hash (#goog.string.hashCode).
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line190">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.gears.factory_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">factory_</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
     </div>


     <div class="entryOverview">
       Cached result of getFactory
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line118">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.gears.hasFactory_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">hasFactory_</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
     </div>


     <div class="entryOverview">
       Cached result of hasFactory.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_gears_gears.js.source.html#line174">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.gears.schemaDefDummy_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.gears.</span><span class="entryName">schemaDefDummy_</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span>)&gt;<span>&nbsp;|&nbsp;</span><span class="type">null</span>)</div>
     </div>


     <div class="entryOverview">
       HACK(arv): The JSCompiler check for undefined properties sees that these
fields are never set and raises warnings.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_gears_basestore.js.source.html#line512">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package gears</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="gears"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
